﻿class Stagex{
	private	var InQueue:Array;
	private	var OutQueue:Array;
	private var stuffList:Array;
	
	private	var cSource:Object;
	private	var cDestination:Object;
	private  var myName:String;
	
	
	public function Stagex(){
		InQueue = new Array();
		OutQueue = new Array();		
	}
	
	
	//--Public method
	/*
	function generate customer
	function pushCustomer 
	function popCustomer
	
	attribute  => stuff List
	function watch Available stuff // function watch Available customer
	*/
	
	public function generateCustomer(nMember:Number){
		for(var i =0; i<nMember ; i++){
			InQueue[i] = new Object();
			InQueue[i].id = i+1; 
		}
	}
	
	public function pushCustomer(customer:Object){
		InQueue.push(customer);
	}
	
	public function popCustomer(){
		InQueue.pop();
	}
	
	public function shiftCustomer(){
		cDestination.pushCustomer(InQueue[InQueue.length-1]);
		InQueue.pop();
	}
	
	
	
	
	public function set _Name(namex:String){
		myName = namex;
	}
	
	public function get _Name():String{
		return myName;
	}
	
	public function set _Source(src:Object){
		this.cSource = src;
	}
	
	public function set _Destination(des:Object){
		this.cDestination = des;
	}
	
	
	//-- Rewdit Here
	public function get _Source():Object{
		return cSource;
	}
	
	public function get _Destination():Object{
		return cDestination;
	}
}